From: Aleksey Kladov Date: Tue, 27 Mar 2018 22:56:46 +0000 (+0300) Subject: Restore --features args for cargo rustdoc X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~2^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=31e6c96848815d172d470c2e1a85c28fe0a96d7d;p=cargo.git Restore --features args for cargo rustdoc It was accidentally omited when migrating to clap --- diff --git a/src/bin/commands/rustdoc.rs b/src/bin/commands/rustdoc.rs index 2350aed19..abd2c7405 100644 --- a/src/bin/commands/rustdoc.rs +++ b/src/bin/commands/rustdoc.rs @@ -26,6 +26,7 @@ pub fn cli() -> App { "Build all targets (default)", ) .arg_release("Build artifacts in release mode, with optimizations") + .arg_features() .arg_manifest_path() .arg_message_format() .after_help( diff --git a/tests/testsuite/rustdoc.rs b/tests/testsuite/rustdoc.rs index b6ba19bd7..06e20c20e 100644 --- a/tests/testsuite/rustdoc.rs +++ b/tests/testsuite/rustdoc.rs @@ -225,3 +225,29 @@ fn rustdoc_same_name_documents_lib() { )), ); } + +#[test] +fn features() { + let p = project("foo") + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [features] + quux = [] + "#, + ) + .file("src/lib.rs", "") + .build(); + + assert_that( + p.cargo("rustdoc --verbose --features quux"), + execs() + .with_status(0) + .with_stderr_contains("[..]feature=[..]quux[..]"), + ); +}